summon zombie ~ ~ ~ {Tags:["rmr.rotten_pillager_captain", "rmr.new_entity", "rmr.boss"]}

data modify entity @n[tag=rmr.new_entity] CustomName set value '{"translate": "rmr.entity.rotten_pillager_captain", "color": "red"}'
data modify entity @n[tag=rmr.new_entity] CustomNameVisible set value true

execute unless score # rmr.entity.hell_mode matches 1 run attribute @n[tag=rmr.new_entity] generic.max_health modifier add rmr:max_health 80 add_value
execute if score # rmr.entity.hell_mode matches 1 run attribute @n[tag=rmr.new_entity] generic.max_health modifier add rmr:max_health 180 add_value

execute unless score # rmr.entity.hell_mode matches 1 run data modify entity @n[tag=rmr.new_entity] Health set value 100
execute if score # rmr.entity.hell_mode matches 1 run data modify entity @n[tag=rmr.new_entity] Health set value 200

attribute @n[tag=rmr.new_entity] generic.armor modifier add rmr:armor -2 add_value
attribute @n[tag=rmr.new_entity] generic.attack_damage modifier add rmr:attack_damage 2 add_value

execute unless score # rmr.entity.hell_mode matches 1 run attribute @n[tag=rmr.new_entity] generic.movement_speed modifier add rmr:movement_speed -0.05 add_value

data modify entity @n[tag=rmr.new_entity] HandDropChances set value [0, 0]
data modify entity @n[tag=rmr.new_entity] ArmorDropChances set value [0, 0, 0, 0]
data modify entity @n[tag=rmr.new_entity] CanPickUpLoot set value false
execute unless score # rmr.entity.hell_mode matches 1 run data modify entity @n[tag=rmr.new_entity] DeathLootTable set value "rmr:entity/rotten_pillager_captain"
execute if score # rmr.entity.hell_mode matches 1 run data modify entity @n[tag=rmr.new_entity] DeathLootTable set value "rmr:entity/rotten_pillager_captain_hell_drop"

item replace entity @n[tag=rmr.new_entity] armor.head with iron_helmet
item replace entity @n[tag=rmr.new_entity] armor.chest with iron_chestplate
loot replace entity @n[tag=rmr.new_entity] weapon.mainhand loot rmr:item/hatchet

scoreboard players set @n[tag=rmr.new_entity] rmr.entity.timer 0
scoreboard players set @n[tag=rmr.new_entity] rmr.entity.rotten_pillager_captain.stage 0

tag @n[tag=rmr.new_entity] remove rmr.new_entity
